import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { PublishModule } from './page/publish/publish.module';
import { TaskModule } from './page/task/task.module';
import { SelfModule } from './page/self/self.module';
import { MessageTipComponent } from './component/message-tip/message-tip.component';
import { Router } from '@angular/router';
import { HttpClientModule } from '@angular/common/http';
import { PreloadStrategyService } from './providers/preload-strategy.service';
import { WedgesModule } from './base-unit/wedges.module';

@NgModule({
  declarations: [
    AppComponent,
    MessageTipComponent
  ],
  imports: [
  BrowserModule,
    PublishModule,
    TaskModule,
    SelfModule,
    CommonModule,
    FormsModule,
    WedgesModule,
    AppRoutingModule,
    HttpClientModule
  ],
  exports: [
    CommonModule,
    FormsModule
  ],
  providers: [PreloadStrategyService],
  bootstrap: [AppComponent]
})
export class AppModule { 
  constructor(private router: Router) {
    const replacer = (key, value) => (typeof value === 'function') ? value.name : value;

    console.log('Routes: ', JSON.stringify(router.config, replacer, 2));
  };
}
